package com.gxa.autoparts.portal.service.impl;

import com.gxa.autoparts.core.pojo.Address;
import com.gxa.autoparts.core.service.impl.BaseServiceImpl;
import com.gxa.autoparts.portal.mapper.AddressMapper;
import com.gxa.autoparts.portal.service.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author R
 * @data 2022-01-06 15:27
 */
@Service
public class AddressServiceImpl extends BaseServiceImpl<Address> implements AddressService {

    @Autowired
    AddressMapper mapper;


    @Override
    public Address selectByDefault(Long uid) {
        Address address = mapper.selectByDefault(uid);
        return address;
    }

    @Override
    public List<Address> selectByUid(Long uid) {
        List<Address> addresses = mapper.selectByUid(uid);
        return addresses;
    }

    @Override
    public Address selectById(Long userId, Long id) {
        Address address = mapper.selectById(userId, id);
        return address;
    }
}
